package com.cy.dda.web.comm;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.cy.dda.model.Result;
import com.cy.dda.service.tencent.TencentMapService;
import com.cy.dda.web.BaseController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

/**
 * 对接腾讯地图服务api
 *
 * @author: tanyilin
 * @create: 2018年11月30日 下午3:36:19
 */
@Slf4j
@RestController
@RequestMapping("/tencent/map")
@Api(tags = "对接腾讯地图服务api")
public class TencentMapController extends BaseController {

	@Autowired
	private TencentMapService tencentMapService;
	
	@ApiOperation("根据坐标经纬度，逆向解析地址")
	@GetMapping("/get/address")
	public Result<Map<String, Object>> getAddress(@RequestParam String location) {
		Map<String, Object> map = tencentMapService.getAddress(location);
		return ok("解析成功", map);
	}
	
	
}
